using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Localization;
using SinBiota.Model.Entities.CustomAttributes;


namespace SinBiota.Model.Entities
{
    [LocalizedName("Occurrence", NameResourceType = typeof(Strings))]
    public class Occurrence : BaseEntity
    {
        [LocalizedName("Project", NameResourceType = typeof(Strings))]
        public virtual Project Project { get; set; }

        [LocalizedName("OccurrenceAuthor", NameResourceType = typeof(Strings))]
        public virtual OccurrenceAuthor Author { get; set; }

        [LocalizedName("User", NameResourceType = typeof(Strings))]
        public virtual User User { get; set; }

        [LocalizedName("BibliographicalReference", NameResourceType = typeof(Strings))]
        public virtual Publication BibliographicalReference { get; set; }

        [LocalizedName("StartDate", NameResourceType = typeof(Strings))]
        [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldCannotBeEmpty")]
        [ValidDate]
        public virtual string StartDate { get; set; }

        [LocalizedName("EndDate", NameResourceType = typeof(Strings))]
        [ValidDate]
        public virtual string EndDate { get; set; }

        [LocalizedName("Location", NameResourceType = typeof(Strings))]
        public virtual Location Location { get; set; }

        [LocalizedName("AquaticData", NameResourceType = typeof(Strings))]
        public virtual AquaticData AquaticData { get; set; }

        [LocalizedName("Ecosystem", NameResourceType = typeof(Strings))]
        public virtual IList<Ecosystem> Ecosystems { get; private set; }

        [LocalizedName("UncertainInformation", NameResourceType = typeof(Strings))]
        public virtual bool UncertainInformation { get; set; }

        [LocalizedName("Habitat", NameResourceType = typeof(Strings))]
        public virtual IList<Habitat> Habitats { get; private set; }

        [LocalizedName("MicroHabitat", NameResourceType = typeof(Strings))]
        public virtual IList<MicroHabitat> MicroHabitats { get; private set; }

        [LocalizedName("Method", NameResourceType = typeof(Strings))]
        public virtual Method Method { get; set; }

        [LocalizedName("FinalRemarks", NameResourceType = typeof(Strings))]
        public virtual String FinalRemarks { get; set; }

        [LocalizedName("Keywords", NameResourceType = typeof(Strings))]
        public virtual IList<Keyword> Keywords { get; private set; }

        [LocalizedName("RelatedOccurrences", NameResourceType = typeof(Strings))]
        public virtual IList<Occurrence> RelatedOccurrences { get; private set; }

        [LocalizedName("OpenAccessDate", NameResourceType = typeof(Strings))]
        public virtual string OpenAccessDate { get; set; }

        [LocalizedName("RecordDate", NameResourceType = typeof(Strings))]
        [ValidDate]
        public virtual string RecordDate { get; set; }

        [LocalizedName("LastUpdateDate", NameResourceType = typeof(Strings))]
        [ValidDate]
        public virtual string LastUpdateDate { get; set; }

        [LocalizedName("SpecimenList", NameResourceType = typeof(Strings))]
        public virtual IList<Specimen> SpecimenList { get; private set; }


        public Occurrence()
        {
            Ecosystems = new List<Ecosystem>();
            Habitats = new List<Habitat>();
            MicroHabitats = new List<MicroHabitat>();
            Keywords = new List<Keyword>();
            RelatedOccurrences = new List<Occurrence>();
            SpecimenList = new List<Specimen>();
        }

    }


}

